package service;

import dao.UserOperation;
import utils.JdbcUtils;

import java.io.IOException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @author fire'ge
 */
public class RegisterService {
    public static String checkUsername(String username) throws SQLException, IOException {
        Connection connection = JdbcUtils.getConnection();
        ResultSet resultSet = UserOperation.checkUsername(connection, username);
        String trueName = null;
        while(resultSet.next()){
            trueName = resultSet.getString(1);
        }
        return trueName;
    }
}
